package Arrays;

public class ArrayDemo04 {
    public static void main(String[] args) {
        int arr[][]={
                {0,1,2,3,4,656,999,3,10},
                {5,4,3,3,4,656,974,2,123},
                {6,2,6,7,8,666,374,1,887},
        };
        int sum=0,num;
        for (int i=0;i<arr.length;i++){
            for (int j=0;j<arr[i].length;j++){
                System.out.print(arr[i][j]+" ");
                if (j==arr[i].length-1){
                    System.out.println(" ");
                }
                sum+=arr[i][j];
            }
        }
        num=sum/(arr.length*arr[0].length);
        System.out.println("该数组所有元素和为："+sum);
        System.out.println("该数组所有元素平均值为："+num);
    }
}
